<template>
  <header class="project-header">
    <div class="header-left">
      <span class="iconfont">&#xe675;</span>
    </div>
    <div class="header-middle">
      <div class="kw">
        <span class="iconfont">&#xe638;</span> 输入城市/景点/游玩主题
      </div>
      <input class="header-input" type="text /" />
    </div>
    <router-link to="/city">
      <div class="header-right">
        {{this.namedCity}}
        <span class="iconfont">&#xeb6d;</span>
      </div>
    </router-link>
  </header>
</template>

<script>
import { mapState, mapGetters } from "vuex";

export default {
  name: "HomeHeader",
  props: {},
  computed: {
    ...mapState({
      city: "city"
    }),
    ...mapGetters({
      namedCity: "namedCity"
    })
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/variables.styl';
@import '~styles/mixins.styl';

.project-header {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 0.88rem;
  text-align: center;
  font-size: 0.32rem;
  color: #fff;
  background-color: $headerBgColor;
}

.header-left {
  width: 0.8rem;
  height: 100%;
  line-height: 0.88rem;
}

.header-middle {
  position: relative;
  flex: 1; // 设置中间自适应
  margin: 0.14rem 0;
  border-radius: 0.06rem;
  overflow: hidden;
}

.header-middle .kw {
  position: absolute;
  top: 0.18rem;
  left: 0.1rem;
  color: #e4e7ea;
  ellipsis();
}

.header-middle .header-input {
  width: 100%;
  height: 0.6rem;
  border-radius: 0.06rem;
  padding-left: 0.1rem;
}

.header-right {
  min-width: 1.32rem;
  padding: 0 0.06rem;
  height: 100%;
  line-height: 0.88rem;
  color: #fff;
  ellipsis();
}
</style>